<template>
  <div class="un-d-table-setter">
    <el-divider direction="horizontal" content-position="center"
      >动态表格设置</el-divider
    >
    <el-form-item label="表头背景">
      <el-color-picker v-model="activeData.headerBgColor"></el-color-picker>
    </el-form-item>

    <el-form-item label="表头加粗">
      <el-switch v-model="activeData.isBold"> </el-switch>
    </el-form-item>

    <el-form-item label="显示按钮">
      <el-switch v-model="activeData.showFooterBtn"></el-switch>
    </el-form-item>

    <el-form-item label="显示表头">
      <el-switch v-model="activeData.showHeader"></el-switch>
    </el-form-item>
    <un-table-setter
      :active-data="activeData"
      :default-column="defaultColumn"
      :default-col-edit-render="defaultColEditRender"
      table-type="dynamic-table"
    ></un-table-setter>
  </div>
</template>

<script>
import UnTableSetter from "../un-table/Setter.vue";
import {
  getDefaultColumn,
  transferOldValue,
  getDefaultColumnEditRender,
} from "./config";

export default {
  name: "UnDTableSetter",
  components: { UnTableSetter },
  props: {
    activeData: Object,
  },
  data() {
    return {
      defaultColumn: getDefaultColumn(),
      defaultColEditRender: getDefaultColumnEditRender(),
    };
  },
  created() {
    // 先转换一下旧数据
    this.$set(
      this.activeData.__config__,
      "defaultValue",
      transferOldValue(this.activeData.__config__.defaultValue)
    );
  },
  methods: {},
};
</script>

<style></style>
